<?php

/**
 * Description of VirtualLabs_Rest_VirtualLabs_Template
 *
 * @author markos
 */
class VirtualLabs_Rest_VirtualLabs_Template {

    //put your code here
    public function listTemplates() {
        $url = array();
        $url["response"] = "json";
        $url["command"] = "listTemplates";
        $url["templatefilter"] = "executable";
        try {
            $v = new VirtualLabs_Rest_HttpClient_Client();
            $response = $v->call($url);
            $listTemplatesResponse = Zend_Json_Decoder::decode($response);
            return $listTemplatesResponse;
        } catch (Exception $e) {
            throw $e;
        }
    }

    public function listTemplateById($id) {
        $url = array();
        $url["response"] = "json";
        $url["command"] = "listTemplates";
        $url["templatefilter"] = "executable";
        $url["id"] = $id;
        try {
            $v = new VirtualLabs_Rest_HttpClient_Client();
            $response = $v->call($url);
            $listTemplatesResponse = Zend_Json_Decoder::decode($response);
            return $listTemplatesResponse;
        } catch (Exception $e) {
            throw $e;
        }
    }

}

?>
